//
//  DBJDBJLeftBarCell.m
//  DBJ
//
//  Created by 花化华 on 2016/11/14.
//  Copyright © 2016年 itcast. All rights reserved.
//

#import "DBJDBJLeftBarCell.h"
#import <Masonry.h>

@implementation DBJDBJLeftBarCell

- (void)dbjSetupUI{
    [super dbjSetupUI];
    
    //设置背景色
    self.backgroundColor = DBJColor;
    //去除分割线
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    //约束原生imgView
    [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.left.equalTo(self).mas_offset(17);
        make.size.mas_equalTo(CGSizeMake(24, 24));
    }];
    
    //约束原生label
    self.textLabel.font = [UIFont systemFontOfSize:15];
    self.textLabel.textColor = [UIColor whiteColor];
    [self.textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self);
        make.centerY.equalTo(self);
        make.left.equalTo(self.imageView.mas_right).mas_offset(8);
    }];
    
}

- (void)setModel:(NSString *)model{
    _model = model;
    
    //设置label
    self.textLabel.text = model;
    
    //设置img
    //--渲染图片颜色
    UIImage *image = [UIImage imageNamed:model];
    image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
    self.imageView.image = image;
    self.imageView.tintColor = [UIColor whiteColor];
}

@end
